package kr.nexmore.slmsample2.service.board;

import java.util.List;

import kr.nexmore.slmsample2.dao.MyBoardDao;
import kr.nexmore.slmsample2.vo.BoardVo;

import org.eclipse.nebula.widgets.pagination.IPageLoader;
import org.eclipse.nebula.widgets.pagination.PageableController;
import org.eclipse.nebula.widgets.pagination.collections.PageListHelper;
import org.eclipse.nebula.widgets.pagination.collections.PageResult;

public class BoardSampleService implements IPageLoader<PageResult<BoardVo>> {

	private static final BoardSampleService INSTANCE = new BoardSampleService();

	public static BoardSampleService getInstance() {
		return INSTANCE;
	}

	public PageResult<BoardVo> loadPage(PageableController controller) {

		MyBoardDao boardDao = new MyBoardDao();

		List<BoardVo> list = boardDao.select();

		return PageListHelper.createPage(list, controller);
	}

}
